import java.util.ArrayList;

public class DormitorySystem {
    private ArrayList<Room> rooms;

    public DormitorySystem() {
        rooms = new ArrayList<>();
    }
    // 添加房间
    public void addRoom(Room room) {
        rooms.add(room);
    }
    // 获取所有房间
    public ArrayList<Room> getRooms() {
        return rooms;
    }
    // 根据房间号获取房间
    public Room getRoomByNumber(String roomNumber) {
        for (Room room : rooms) {
            if (room.getRoomNumber().equals(roomNumber)) {
                return room;
            }
        }
        return null;
    }
}
